/*
** Copyright (C) 2010 Calin Radoni
**
** This file is part of CHScanner.
**
** CHScanner is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** CHScanner is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with CHScanner. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include <vector>

#include "WorkCfg.h"
#include "MMsgDisplay.h"

class WorkCfgManager
{
private:
	std::vector<WorkCfg*> theVector;
	std::vector<WorkCfg*>::iterator iter;
	void CleanUp(void);

	bool BuildList(void);

	void SortList(void);

	DWORD localIP;
	DWORD localIPMask;

public:
	WorkCfgManager(void);
	~WorkCfgManager(void);

	MMsgDisplay* display;

	CString applicationPath;

	bool AddConfig(WorkCfg*);

	void Refresh(void);

	bool SaveConfig(WorkCfg*);
	bool DeleteConfig(WorkCfg*);

	int GetSize(void);
	WorkCfg* GetByIdx(int);

	CString GetFullConfigFileName(CString);

	void SetLocalIPandMask(DWORD, DWORD);
	bool SaveExampleConfigurations(void);
};
